try:
    from mongomock import MongoClient
except ImportError:
    from pymongo import MongoClient

from bson.objectid import ObjectId

client = MongoClient('mongodb://localhost')
db = client.test

db.my_coll.insert_one({'index': 1})
db.my_coll.insert_one({'index': 2})

# for item in db.my_coll.find():
#     print(item)
#
# print(db.list_collection_names)

print(db.my_coll.find_one({'index': 2}))

obj_id = ObjectId('619616045758124c7293550c')
print(db.my_coll.find_one({'_id': obj_id}))
